import * as actionTypes from './constants';

const defaultstate = {
    // maindata: [],
    // num: 9,
    index: 0 // tabbar哪个被激活？ 核心状态 
}

export const reducer = (state = defaultstate, action) => {
    switch (action.type) {
        case actionTypes.SET_INDEX:
            return {...state, index: action.data}
        default:
            return state;
    }
}